#include "Factory.h"

class NYStyleCheesePizza:public Pizza
{
public:
	NYStyleCheesePizza(){ cout<<"NYStyleCheesePizza constructed\n"; }
	NYStyleCheesePizza(int i):m_i(i) {}

	virtual ~NYStyleCheesePizza(){}

private:
	int m_i;

};

class ChicagoStyleCheesePizza:public Pizza
{
public:
	ChicagoStyleCheesePizza(){ cout<<"ChicagoStyleCheesePizza constructed\n";}
	ChicagoStyleCheesePizza(int i):m_i(i)
	{

	}

	virtual ~ChicagoStyleCheesePizza(){}

private:
	int m_i;

};


//this is a comment

class NYStylePizzaStore:public PizzaStore
{
public:
	NYStylePizzaStore()
	{

	}
	virtual ~NYStylePizzaStore()
	{

	}
	friend class NYStyleCheesePizza;
	Pizza* createPizza(string type)
	{
		Pizza* ipizza;
		IngredientFactory* pFactory = new NyIngredientFactory();
		if( !strcmp( "cheese",type.c_str()) )
		{
			//ipizza = new NYStyleCheesePizza();
			ipizza = new cheesePizza( pFactory );
			return ipizza;
		}


	}
};

class ChicagoStylePizzaStore:public PizzaStore
{
public:
	
	ChicagoStylePizzaStore()
	{

	}
	virtual ~ChicagoStylePizzaStore()
	{

	}
	friend class ChicagoStyleCheesePizza;
	Pizza* createPizza(string type)
	{
		Pizza* ipizza;
		IngredientFactory* iFactory = new ChIngredientFactory();
		if( !strcmp( "cheese",type.c_str()) )
		{
			ipizza = new clamPizza(iFactory);
			return ipizza;
		}


	}
};





int main()
{
	PizzaStore* nyps = new NYStylePizzaStore();
	PizzaStore* chps = new ChicagoStylePizzaStore();

	Pizza* nyp = nyps->OrderPizza( "cheese" );
	cout<<"i just ordered nystylecheesepizza"<<endl;

	Pizza* chp = chps->OrderPizza("cheese");
	cout<<"i ordered chicagosytlecheesepizza"<<endl;


	delete chps;
	delete nyps;

	cin.get();

	return 0;
}